home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 365_02 / vars.c < prev    next >
C/C++ Source or Header  |  1992-04-04  |  4KB  |  116 lines

  1. /* vars.c */
  2.  
  3. /* Author:
  4.  *    Steve Kirkendall
  5.  *    14407 SW Teal Blvd. #C
  6.  *    Beaverton, OR 97005
  7.  *    kirkenda@cs.pdx.edu
  8.  */
  9.  
  10.  
  11. /* This file contains variables which weren't happy anyplace else */
  12.  
  13. #include "config.h"
  14. #include "vi.h"
  15.  
  16. /*------------------------------------------------------------------------*/
  17.  
  18. /* used to remember whether the file has been modified */
  19. struct _viflags    viflags;
  20.  
  21. /* used to access the tmp file */
  22. long        lnum[MAXBLKS];
  23. long        nlines;
  24. int        tmpfd = -1;
  25. int        tmpnum;
  26. #ifndef CRUNCH
  27. int        wset = FALSE;
  28. #endif
  29.  
  30. /* used to keep track of the current file & alternate file */
  31. long        origtime;
  32. char        origname[256];
  33. char        prevorig[256];
  34. long        prevline = 1;
  35.  
  36. /* used to track various places in the text */
  37. MARK        mark[NMARKS];    /* marks 'a through 'z, plus mark '' */
  38. MARK        cursor;        /* the cursor position within the file */
  39.  
  40. /* which mode of the editor we're in */
  41. int        mode;        /* vi mode? ex mode? quitting? */
  42.  
  43. /* used to manage the args list */
  44. char        args[BLKSIZE];    /* list of filenames to edit */
  45. int        argno;        /* index of current file in args list */
  46. int        nargs;        /* number of filenames in args[] */
  47.  
  48. /* dummy var, never explicitly referenced */
  49. int        bavar;        /* used only in BeforeAfter macros */
  50.  
  51. /* used to detect changes that invalidate cached text/blocks */
  52. long        changes;    /* incremented when file is changed */
  53. int        significant;    /* boolean: was a *REAL* change made? */
  54.  
  55. /* used to support the pfetch() macro */
  56. int        plen;        /* length of the line */
  57. long        pline;        /* line number that len refers to */
  58. long        pchgs;        /* "changes" level that len refers to */
  59. char        *ptext;        /* text of previous line, if valid */
  60.  
  61. /* misc temporary storage - mostly for strings */
  62. BLK        tmpblk;        /* a block used to accumulate changes */
  63.  
  64. /* screen oriented stuff */
  65. long        topline;    /* file line number of top line */
  66. int        leftcol;    /* column number of left col */
  67. int        physcol;    /* physical column number that cursor is on */
  68. int        physrow;    /* physical row number that cursor is on */
  69.  
  70. /* used to help minimize that "[Hit a key to continue]" message */
  71. int        exwrote;    /* Boolean: was the last ex command wordy? */
  72.  
  73. /* This variable affects the behaviour of certain functions -- most importantly
  74.  * the input function.
  75.  */
  76. int        doingdot;    /* boolean: are we doing the "." command? */
  77.  
  78. /* This variable affects the behaviour of the ":s" command, and it is also
  79.  * used to detect & prohibit nesting of ":g" commands
  80.  */
  81. int        doingglobal;    /* boolean: are doing a ":g" command? */
  82.  
  83. /* This variable is zeroed before a command executes, and later ORed with the
  84.  * command's flags after the command has been executed.  It is used to force
  85.  * certain flags to be TRUE for *some* invocations of a particular command.
  86.  * For example, "/regexp/+offset" forces the LNMD flag, and sometimes a "p"
  87.  * or "P" command will force FRNT.
  88.  */
  89. int        force_flags;
  90.  
  91. /* These are used for reporting multi-line changes to the user */
  92. long        rptlines;    /* number of lines affected by a command */
  93. char        *rptlabel;    /* description of how lines were affected */
  94.  
  95. /* These store info that pertains to the shift-U command */
  96. long    U_line;            /* line# of the undoable line, or 0l for none */
  97. char    U_text[BLKSIZE];    /* contents of the undoable line */
  98.  
  99.  
  100. #ifndef NO_VISIBLE
  101. /* These are used to implement the 'v' and 'V' commands */
  102. MARK    V_from;            /* starting point for v or V */
  103. int    V_linemd;        /* boolean: doing line-mode version? (V, not v) */
  104. #endif
  105.  
  106. /* Bigger stack req'ed for TOS and TURBOC */
  107.  
  108. #if TOS
  109. long    _stksize = 16384;
  110. #endif
  111.  
  112. #if TURBOC
  113. #include <dos.h>
  114. extern unsigned _stklen = 16384U;
  115. #endif
  116.